import tkinter as tk
from tkinter import font
import time,datetime

class ClockApp(tk.Tk):
    def __init__(self):
        super().__init__()
        self.title("时间显示器")
        self.geometry("300x200")
        self.configure(bg='white')

        self.time_font = font.Font(family="Helvetica", size=48, weight="bold")
        self.date_font = font.Font(family="Helvetica", size=16)

        self.time_label = tk.Label(self, text="", font=self.time_font, bg='white')
        self.time_label.pack(pady=30)

        self.date_label = tk.Label(self, text="", font=self.date_font, bg='white')
        self.date_label.pack()

        self.update_time()
        self.update_date()

    def update_time(self):
        current_time = time.strftime('%H:%M:%S')
        self.time_label.config(text=current_time)
        self.time_label.after(1000, self.update_time)

    def update_date(self):
        current_date = datetime.date.today().strftime('%Y-%m-%d')
        self.date_label.config(text=current_date)

if __name__ == "__main__":
    app = ClockApp()
    app.mainloop()